//
//  FLpinjielingshengView.m
//  FeeLing
//
//  Created by 乔光玉 on 2019/1/14.
//  Copyright © 2019年 大仙儿飘. All rights reserved.
//
#import "SKVoiceWaveView.h"
#import "SFDualWaySlider.h"
#import "FLpinjielingshengView.h"

@implementation FLpinjielingshengView
-(instancetype)initWithFrame:(CGRect)frame withasset:(AVAsset *)asst{

    self = [super initWithFrame:frame];
    if (self)
    {
        [self initViewwithasset:asst];
    }
    return self;
}
-(void)initViewwithasset:(AVAsset *)asst{
    self.backgroundColor = [UIColor colorWithRed:74/255.0 green:88/255.0 blue:232/255.0 alpha:0.29];
    self.layer.cornerRadius = 4;
    self.clipsToBounds = YES;
    self.userInteractionEnabled = YES;
    self.layer.borderColor = [UIColor colorWithHexString:@"#4C58E9"].CGColor ;
    self.layer.borderWidth = 2;
    
    
    _waveView= [[SKVoiceWaveView alloc]initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    _waveView.backgroundColor = [UIColor clearColor];
   
    _waveView.asset = asst; //指定媒体
    
    _waveView.lineWidth = 0;//线宽，默认0，0则为连续的视图，可测试
    _waveView.lineColor = [UIColor colorWithHexString:@"#6E7370"];//颜色，默认灰色
    _waveView.lineDistance = 4;//线之间的距离，默认4
    [self addSubview:_waveView];
    
    self.seclte = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"减去"]];
    self.seclte.userInteractionEnabled = YES;
    self.seclte.frame = CGRectMake(self.width-22, 0, 22, 22);
    UITapGestureRecognizer * tap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(Tap:)];
    [self.seclte addGestureRecognizer:tap];
    [self addSubview:self.seclte];
    
    
    
    
    
    
    
}
-(void)Tap:(UITapGestureRecognizer *)tap{
    
    self.deleBlock(tap);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
